﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/Site.Master" AutoEventWireup="true" CodeBehind="WFVisualizarTarefas.aspx.cs" Inherits="s2b.ControleDesenvolvimentoProjetos.WFVisualizarTarefas" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:CS_DB_Controle_Projeto %>" 
        
        
        
        SelectCommand="SELECT   C.RAZAO_SOCIAL,  T.ID_TAREFA, P.NOME_PROJETO AS Projeto, SP.DESC_STATUS AS [Status Projeto], F.NOME_FUNC AS Colaborador, T.NOME_TAREFA AS Tarefa, 
                      T.PORC_CONCLUSAO AS Porcentagem, S.DESC_STATUS AS [Status Tarefa], T.DT_INICIO_TAREF AS [Data inicial Tarefa], T.DT_FINAL_TAREFA AS [Data final Tarefa], 
                      T.CARGA_HORARIA AS [Carga horária], T.CARG_HOR_UTILIZ AS [Carga horária utilizada]
FROM         TAREFAS AS T INNER JOIN
                      PROJETO AS P ON P.ID_PROJETO = T.ID_PROJETO LEFT OUTER JOIN
                      FUNCIONARIO AS F ON F.ID_FUNC = T.ID_FUNC INNER JOIN
                      STATUS AS S ON S.ID_STATUS = T.ID_STATUS INNER JOIN
                      STATUS AS SP ON SP.ID_STATUS = P.ID_STATUS
INNER JOIN
CLIENTE AS C ON C.ID_CLIENTE = P.ID_CLIENTE
WHERE     (P.ID_PROJETO = @ID_PROJETO) OR
                      (T.ID_TAREFA =@ID_TAREFA) OR
                      (F.ID_FUNC = @ID_FUNC) OR
                      (P.ID_CLIENTE = @ID_CLIENTE)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID_PROJETO" QueryStringField="ID_PROJETO" 
                DefaultValue="0" />
            <asp:QueryStringParameter Name="ID_TAREFA" QueryStringField="ID_TAREFA" 
                DefaultValue="0" />
            <asp:QueryStringParameter Name="ID_FUNC" QueryStringField="ID_FUNC" 
                DefaultValue="0" />
            <asp:QueryStringParameter DefaultValue="0" Name="ID_CLIENTE" 
                QueryStringField="ID_CLIENTE" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"  Width="100%"
        DataKeyNames="ID_TAREFA" DataSourceID="SqlDataSource1" 
        onrowcommand="GridView1_RowCommand" BackColor="White" BorderColor="#999999" 
        BorderStyle="Solid" BorderWidth="1px" CellPadding="3" ForeColor="Black" GridLines="Vertical" 
       >
        <AlternatingRowStyle BackColor="#CCCCCC" />
        <Columns>
            <asp:BoundField DataField="RAZAO_SOCIAL" HeaderText="RAZAO_SOCIAL" 
                SortExpression="RAZAO_SOCIAL" />
            <asp:BoundField DataField="ID_TAREFA" HeaderText="ID_TAREFA" 
                InsertVisible="False" ReadOnly="True" SortExpression="ID_TAREFA" />
            <asp:BoundField DataField="Projeto" 
                HeaderText="Projeto" SortExpression="Projeto" />
            <asp:BoundField DataField="Status Projeto" HeaderText="Status Projeto" 
                SortExpression="Status Projeto" />
            <asp:BoundField DataField="Colaborador" HeaderText="Colaborador" 
                SortExpression="Colaborador" />
            <asp:BoundField DataField="Tarefa" HeaderText="Tarefa" 
                SortExpression="Tarefa" />
            <asp:BoundField DataField="Porcentagem" HeaderText="Porcentagem" 
                SortExpression="Porcentagem" />
            <asp:BoundField DataField="Status Tarefa" HeaderText="Status Tarefa" 
                SortExpression="Status Tarefa" />
            <asp:BoundField DataField="Data inicial Tarefa" 
                HeaderText="Data inicial Tarefa" SortExpression="Data inicial Tarefa" />
            <asp:BoundField DataField="Data final Tarefa" HeaderText="Data final Tarefa" 
                SortExpression="Data final Tarefa" />
            <asp:BoundField DataField="Carga horária" 
                HeaderText="Carga horária" SortExpression="Carga horária" />
            <asp:BoundField DataField="Carga horária utilizada" 
                HeaderText="Carga horária utilizada" SortExpression="Carga horária utilizada" />
                      <asp:ButtonField ButtonType="Image" CommandName="Delete" ImageUrl="~/Util/Imagens/delete.png"
                Text="Remover"></asp:ButtonField>
                <asp:ButtonField ButtonType="Image" CommandName="Edit"  ImageUrl="~/Util/Imagens/edit.png"
                Text="Editar"></asp:ButtonField>
                <asp:ButtonField ButtonType="Image" CommandName="View"  ImageUrl="~/Util/Imagens/view.png"
                Text="Visualizar"></asp:ButtonField>
                 <asp:ButtonField ButtonType="Image" CommandName="Atribuir"  ImageUrl="~/Util/Imagens/task.png"
                Text="Atribuir"></asp:ButtonField>
        </Columns>
        <FooterStyle BackColor="#CCCCCC" />
        <HeaderStyle BackColor="#000040" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#999999" ForeColor="#000040" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F1F1F1" />
        <SortedAscendingHeaderStyle BackColor="#808080" />
        <SortedDescendingCellStyle BackColor="#CAC9C9" />
        <SortedDescendingHeaderStyle BackColor="#383838" />
    </asp:GridView>
</asp:Content>
